Page({
  data: {
    RepairList: [],
    statusMsg: {
      0: '已取消',
      1: '受理中',
      2: '上门中',
      3: '已完成'
    },
    statusType: {
      0: 'cancel',
      1: 'info',
      2: 'success',
      3: 'complete'
    }
  },
  goDetail(e) {
    // console.log(e.mark.id);
    wx.navigateTo({
      url: '/repair_pkg/pages/detail/index?id=' + e.mark.id,
    })
  },
  addRepair() {
    wx.navigateTo({
      url: '/repair_pkg/pages/form/index',
    })
  },
  onShow() {
    this.getRepairList()
  },
  //获取报修列表数据
  async getRepairList() {
    const res = await wx.http.get('/repair', { current: 1, pageSize: 10 })
    // console.log(res.data.rows);
    this.setData({
      RepairList: res.data.rows
    })
  }
})
